package pl.edu.pk.mech.kkbus.model;

import java.io.Serializable;
import java.util.Date;

import com.google.appengine.api.datastore.Entity;
import static pl.edu.pk.mech.kkbus.staticstrings.RefuelingProperty.*;

public class Refueling extends Pojo implements Serializable{

	private static final long serialVersionUID = 4911681669590187733L;
	private Double capacity;
    private Date date;
    private Double costs;
    private long idBus;
    
    public Refueling(){}
    
    public Refueling(Entity entity){
    	this.id = entity.getKey().getId();
    	this.capacity = Double.valueOf(entity.getProperty(REFUELING_CAPACITY).toString());
    	this.date = (Date) entity.getProperty(REFUELING_DATE);
    	this.costs = Double.valueOf(entity.getProperty(REFUELING_COSTS).toString());
    	this.idBus = Long.valueOf(entity.getProperty(REFUELING_ID_BUS).toString());
    }
    
	public Double getCapacity() {
		return capacity;
	}

	public void setCapacity(Double capacity) {
		this.capacity = capacity;
	}

	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public Double getCosts() {
		return costs;
	}
	public void setCosts(Double costs) {
		this.costs = costs;
	}

	public long getIdBus() {
		return idBus;
	}

	public void setIdBus(long idBus) {
		this.idBus = idBus;
	}
}
